@extends('home.base')
@section('title', '楼盘位置')
@section('content')
@include('home.header')
<style>
    #allmap {
        width: 100%;
        height: 600px;
        overflow: hidden;
        margin: 0;
    }
</style>
<div id="allmap"></div>
<input type="hidden" id="title" value="{{$title}}">
<input type="hidden" id="lng" value="{{$lng}}">
<input type="hidden" id="lat" value="{{$lat}}">
@include('home.footer')
@endsection
@section('script')
<script type="text/javascript"
        src="http://api.map.baidu.com/api?v=2.0&ak=2pOLT55iaTI8LVvPfirAgUDqaZa0sdnj"></script>
<script type="text/javascript">
    // 百度地图API功能
    var map = new BMap.Map("allmap");
    var lng = document.getElementById("lng").value;
    var lat = document.getElementById("lat").value;
    var title = document.getElementById("title").value;
    map.centerAndZoom(new BMap.Point(lng, lat), 11);
    map.enableScrollWheelZoom(true);
    var MyIcon = new BMap.Icon("/images/tip.png", new BMap.Size(26, 28));
    MyMarker = new BMap.Marker(new BMap.Point(lng, lat), {icon: MyIcon});
    MyMarker.setAnimation(BMAP_ANIMATION_BOUNCE);
    map.enableScrollWheelZoom();
    map.centerAndZoom(new BMap.Point(lng, lat), 15);
    map.addOverlay(MyMarker);
    var label = new BMap.Label(title, {offset: new BMap.Size(20, -10)});
    MyMarker.setLabel(label);
</script>
@endsection